<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>路客海外深度游</title>
<meta name="keywords" content=""/>
<meta name="description" content=""/>

	<!--[if lt IE 9]>
	  <%= javascript_include_tag 'html5shiv-printshiv' %>
	<![endif]-->
	
	<%= stylesheet_link_tag "application", media: "all" %>
	<%= javascript_include_tag "application" %>
</head>
<body>
	<div class="header">
		<%= link_to (image_tag "title.png", alt: "路客海外深度游", class: "title"), root_path %>
		<% if current_user %>
			<%= current_user.email%>
			<%= link_to '退出',  destroy_user_session_path, method: :delete, data: { confirm: '确定退出?' } %>
		<% else %>
			<a class="login btn01" data-toggle="modal" href="#login-modal">登录 | </a>
			<a class="login btn02" data-toggle="modal" href="#signup-modal">注册</a>
		<% end %>
		<%#= image_tag "English.png", alt: "English_version", class: "english" %>
	</div>
	<div class="logo">
		<%= link_to (image_tag "logo.png", alt: "路客海外深度游"), root_path %>
	</div>

	<%= content_for?(:content) ? yield(:content) : yield %>

	<footer>
	  <div class="f_c">
	   	<div class="f_dis f_1">	
	      <div>			
			   	<ul>
						<% About.order("id ASC").limit(2).each do |about|%>
							<li><%= link_to about.name, about_path(tab: about.name) %></li>
						<% end %>
			   	</ul>
				</div>
			</div>
			<div class="f_1">
				<ul>
					<% About.order("id ASC").offset(2).limit(4).each do |about|%>
						<li><%= link_to about.name, about_path(tab: about.name) %></li>
					<% end %>
				</ul>
			</div>
			<div class="f_1">
				<%= image_tag "QR.png" %>
			</div>
		</div>  
	</footer>

<script type="text/javascript">
	$(document).ready(function(){

		$("a.forgot").click(function(){
			$("#login-modal").modal("hide");
			$("#forgetform").modal({show:!0})
		});
		
		$("#signup-modal").modal("hide");
		$("#forgetform").modal("hide");
		$("#login-modal").modal("hide");
		$("#activation-modal").modal("hide");
		$("#setpassword-modal").modal("hide");
		
	});
</script>  
<div class="modal" id="login-modal" style="display: none;">
	<a class="close" data-dismiss="modal">×</a>
	<h1>登录</h1>

	 <!-- destroy_user_session_path  -->

	<%= form_for User.new, url: user_session_path,   html:{class: "login-form clearfix" } do |f|%>
		<div class="form-arrow"></div>
		<%= tag(:input, :type => "hidden", :name =>   request_forgery_protection_token.to_s, :value =>   form_authenticity_token) %> 
		<%= f.email_field :email, autofocus: true, placeholder: "邮箱："%>
		<%= f.password_field :password, placeholder: '密码：'  %>
		<input type="submit" name="type" class="button-blue login" value="登录">
		<input type="hidden" name="return-url" value="">
		<div class="clearfix"></div>
		<label class="remember"><input name="remember" type="checkbox" checked="">下次自动登录 </label>
		<a class="forgot">忘记密码？</a>
	<% end %>
</div>
<div class="modal" id="forgetform" style="display: none;">
	<a class="close" data-dismiss="modal">×</a>
	<h1>忘记密码</h1>
	<form class="forgot-form" method="post" action="http://www.17sucai.com">
		<input name="email" value="" placeholder="注册邮箱：">
		<div class="clearfix"></div>
		<input type="submit" name="type" class="forgot button-blue" value="发送重设密码邮件">
	</form>
</div>
<div class="modal" id="setpassword-modal" style="display: none;">
	<a class="close" data-dismiss="modal">×</a>
	<h1>重置密码</h1>
	<form class="signup-form clearfix" method="post" action="http://www.17sucai.com">
		<input name="email" value="">
		<input name="password" type="password" placeholder="密码：">
		<input name="password2" type="password" placeholder="确认密码：">
		<input name="token" type="hidden" value="">
		<input type="submit" name="type" class="button-blue reg" value="设置新密码并登录" data-action="reset">
		<div class="clearfix"></div>
	</form>
</div>
<div class="modal" id="signup-modal" style="display:none;">
	<a class="close" data-dismiss="modal">×</a>
	<h1>注册</h1>
	<%= form_for(User.new, url: user_registration_path, remote: true, html: {class: "signup-form clearfix"}) do |f| %>
			<%= tag(:input, :type => "hidden", :name =>   request_forgery_protection_token.to_s, :value =>   form_authenticity_token) %> 
			<p class="error"></p>
			<%= f.email_field :email, autofocus: true, placeholder: "邮箱："%>
			<%= f.password_field :password, placeholder: '密码：'  %>
			<%= f.password_field :password_confirmation, placeholder: '确认密码：'  %>
			<%= f.text_field :name, placeholder: '微信名称：'  %>
			<div class="clearfix"></div>
			<input type="submit" name="type" class="button-blue reg" value="注册" data-action="regist">
		<% end %>
</div>

  <script type="text/javascript">
      $(function() {
        //    fancybox
          jQuery(".fancybox").fancybox();
      });

  </script>

</body>
</html>